import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { APIBase } from '../../base/api-base';
import { ZoneResource } from '../../zone/services/zone.service';

@Injectable({
  providedIn: 'root',
})
export class FormServiceService {
  constructor(
    private http: HttpClient,
  ) {

  }

  data(params?, type?) {
    return this.http.get('/api/admin/report/' + (['pc_online_ratio', 'pc_online_timesecs'][type - 1]), {
    // return this.http.get('/api/admin/' + (['pc_onlinestat', 'pc_onlineduration'][type - 1]), {
      params
    }).toPromise()
  }
}
